<?php
if(session::is_manager()==TRUE)
{
	require_once 'html/admintemplate.php';
}
else 
{
	require_once 'html/sellerTemplate.php';
}
if(empty($getPpOrderHistory))
{
	echo "empty History";
}
else 
{
	?>
	<table width="100%" border="1">
	<tr>
	<td colspan="7" >
	<?php 
	
if($previosPage!=0)
{
	echo "<a href='sellerHistory.php?agent=$agent&pageid=$previosPage' ><b>Trang Truoc</b></a>";
}
for($idPage=$minPage;$idPage<$page_id;$idPage++)
	{
		echo "<a href='sellerHistory.php?agent=$agent&pageid=$idPage' > $idPage </a>";
		
	}
	echo "<b>$page_id </b>";
	
for($idPage=$page_id+1;$idPage<=$maxPage;$idPage++)
	{
		echo "<a href='sellerHistory.php?agent=$agent&pageid=$idPage' >$idPage </a>";
	}
	if($nextPage!=0)
	{
		echo "<a href='sellerHistory.php?agent=$agent&pageid=$nextPage' ><b>Nex Page</b></a>";
	}
	?>
	</td>
	</tr>
	<tr class="classtopmenu">
	<td>
	Order Id
	</td>
	<td>
	Time Order
	</td>
	<td>
	User Name
	</td>
	<td>
	Type
	</td>
	<td>
	Money
	</td>
	<td>
	Refund
	</td>
	<td>
	Seller
	</td>
	</tr>
	
	<?php
	foreach($getPpOrderHistory as $orderHistory)
	{
		$type=$orderHistory['type'];
		if(session::is_seller()==TRUE)
		{
			$orderHistory['money']="***";	
		}
		$Js=$orderHistory['userid'].",".$orderHistory['orderid'].",'".$type."'";
		?>
		<tr>
		<td>
		<a href="javascript:viewoderhistory(<?php echo $Js;?>)" ><?php echo $orderHistory['id'];?></a>
	</td>
	<td>
	<?php echo $orderHistory['timeorder'];?>
	</td>
	<td>
	<?php echo $orderHistory['userid'];?>
	</td>
	<td>
	<?php echo $orderHistory['type'];?>
	</td>
	<td>
	<?php echo $orderHistory['money'];?>
	</td>
	<td>
	<?php echo $orderHistory['refund'];?>
	</td>
	<td>
	<?php echo $orderHistory['site'];?>
	</td>
		</tr>
		<tr >
	<td colspan=7 id="returnorderdetail<?php echo $orderHistory['orderid'];?>" >
	</td>
	</tr>
		<?php
	}
	?>
	</table>
	<?php
}

?>